<template>
    <div>
        <input type="text" v-model="text" @keyup.enter="ent">
        <ul v-for="(item ,idx) of todolist" :key="idx">
          <li>{{item}} <button @click="remove(idx)">*</button></li>
        </ul>
    </div>
</template>

<script> 
export default {
  data(){
    return{
      text:'',
      todolist:[],
     
    }
  },
  methods:{
    ent(){
      if(!this.text) return
      this.todolist.push(this.text)
      this.text=""
    },
    remove(idx){
      this.todolist.splice(idx,1)
    }
  }
}
</script>


<style lang="stylus" scoped>

</style>
